﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using _MetalSlug.MyCharacters.Characters;
using _MetalSlug.Soldiers.Units;
using _MetalSlug.Soldiers.Factory;
using _MetalSlug.Form;
using _MetalSlug.Form.OptionScreen;
using _MetalSlug.Form.SelectCharScreen;
using _MetalSlug.Form.LoadingScreen;
using _MetalSlug.Form.PlayGame;
using _MetalSlug.Form.ScreenSystem;
using _MetalSlug.Form.GameOver;
using _MetalSlug.Form.MenuScreen;
using _MetalSlug.Mementoes;


namespace _MetalSlug
{
    public class MetalSlug
    {
        public MetalSlug()
        {
        }

        public void LoadContent(SpriteFont font)
        {
            SelectCharScreen MySelectCharScreen = new SelectCharScreen();
            GameManager.GetInstance().Register(MySelectCharScreen);

            MenuScreen MyMenuScreen = new MenuScreen();
            GameManager.GetInstance().Register(MyMenuScreen);

            OptionScreen MyOptionScreen = new OptionScreen(font);
            GameManager.GetInstance().Register(MyOptionScreen);

            LoadingScreen MyLoadingScreen = new LoadingScreen();
            GameManager.GetInstance().Register(MyLoadingScreen);

            PlayGameScreen MyPlayGameScreen = new PlayGameScreen();
            GameManager.GetInstance().Register(MyPlayGameScreen);

            GameOverScreen MyGameOverScreen = new GameOverScreen();
            GameManager.GetInstance().Register(MyGameOverScreen);

        }

       
        public void Draw(SpriteBatch spriteBatch)
        {
            MyScreen CurrentScreen = GameManager.GetInstance().GetCurrentScreen();
            if(CurrentScreen!=null)
            {
                CurrentScreen.Draw(spriteBatch);
            }
        }

    
        public void Update(GameTime gameTime)
        {
            MyScreen CurrentScreen = GameManager.GetInstance().GetCurrentScreen();
            if (CurrentScreen != null)
            {
                CurrentScreen.Update(gameTime);
            }

        }    
    }
}
